<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

function miniEditor($name='miniContent', $jsLoad = 0, $class = 'mEditor') 
{
    $jsTiny = '<script type="text/javascript" src="/data/js/tiny_mce/tiny_mce.js"></script>';
    $skin = 'o2k7';
    
    $str = $jsLoad == 0 ? $jsTiny : "";
    $str .= '
    <script type="text/javascript">
       tinyMCE.init({
	  mode : "exact",
      //skin : "'.$skin.'",
      elements : "'.$name.'",
	  theme : "simple",
      content_css : "/data/js/tiny_mce/css/content.css"
    });
    </script>';
    return $str;
}

function norEditor($name = 'norContent', $jsLoad = 0, $class = 'nEditor') 
{
    $jsTiny = '<script type="text/javascript" src="/data/js/tiny_mce/tiny_mce.js"></script>';
    $skin = 'o2k7';
    
    $str = $jsLoad == 0 ? $jsTiny : "";
    $str .= '
        <script type="text/javascript">
	tinyMCE.init({
        //language : "vi",
		mode : "exact",
        entity_encoding  : "raw",
        skin : "'.$skin.'",
        elements : "'.$name.'",
		theme : "advanced",
		plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,imagemanager,autosave",

		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,image,code",
		theme_advanced_buttons3 : "",
        
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
        // lay duong dan tuong doi :D
        //document_root_url : "/data/",
        //relative_urls : false,
        //remove_script_host : false,
	
		content_css : "/data/js/tiny_mce/css/content.css"
	});
    </script>';
    return $str;
}

function fullEditor($name='fullContent', $jsLoad = 0, $class = 'fEditor')
{
    $jsTiny = '<script type="text/javascript" src="/data/js/tiny_mce/tiny_mce.js"></script>';
    $skin = 'o2k7';
    
    $str = $jsLoad == 0 ? $jsTiny : "";
    $str .= '
    <script type="text/javascript">
    	tinyMCE.init({
    		//language : "vi",
    		mode : "exact",
            entity_encoding  : "raw",
            //skin : "'.$skin.'",
            elements : "'.$name.'",
    		theme : "advanced",
    		plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,imagemanager",
    		// Theme options
    		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
    		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
    		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
    		theme_advanced_toolbar_location : "top",
    		theme_advanced_toolbar_align : "left",
    		theme_advanced_statusbar_location : "bottom",
    		theme_advanced_resizing : true,
            // lay duong dan tuong doi :D
            document_root_url : "/data/assets",
            relative_urls : false,
            remove_script_host : true,
    		content_css : "/data/js/tiny_mce/css/content.css"
    	});
    </script>';
    return $str;
}

function topicEditor($name='miniContent', $jsLoad = 0, $class = 'mEditor') 
{
    $jsTiny = '<script type="text/javascript" src="/data/js/tiny_mce/tiny_mce.js"></script>';
    $skin = 'o2k7';
    
    $str = $jsLoad == 0 ? $jsTiny : "";
    $str .= '
        <script type="text/javascript">
	tinyMCE.init({
		mode : "exact",
        entity_encoding  : "raw",
        skin : "'.$skin.'",
        elements : "'.$name.'",
		theme : "advanced",
		plugins : "emotions",

		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,emotions,fontsizeselect",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "",
        
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
		content_css : "/data/js/tiny_mce/css/content.css"
	});
    </script>';
    return $str;
}